package com.yiwei.zxp.api.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.yiwei.zxp.api.bean.ResponModel;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by xsooy-pc on 18-5-28.
 */

public class AddressListsModel extends ResponModel implements Parcelable {

    public List<DatasBean> datas;

    public static class DatasBean implements Parcelable {
        /**
         * id : 1
         * user_id : 121
         * name : 李小明
         * phone : 13712345678
         * province_id : 423
         * city_id : 442
         * district_id : 443
         * address : 友谊路1哈
         * is_default : 0
         * is_effect : 1
         * updated_at : 1527306575
         * created_at : 1527306575
         */

        public String id;
        public int user_id;
        public String name;
        public String phone;
        public String province_id;
        public String city_id;
        public String district_id;
        public String address;
        public int is_default;
        public int is_effect;
        public String updated_at;
        public String created_at;
        public String headAddress;

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeInt(this.user_id);
            dest.writeString(this.name);
            dest.writeString(this.phone);
            dest.writeString(this.province_id);
            dest.writeString(this.city_id);
            dest.writeString(this.district_id);
            dest.writeString(this.address);
            dest.writeInt(this.is_default);
            dest.writeInt(this.is_effect);
            dest.writeString(this.updated_at);
            dest.writeString(this.created_at);
            dest.writeString(this.headAddress);
        }

        public DatasBean() {
        }

        protected DatasBean(Parcel in) {
            this.id = in.readString();
            this.user_id = in.readInt();
            this.name = in.readString();
            this.phone = in.readString();
            this.province_id = in.readString();
            this.city_id = in.readString();
            this.district_id = in.readString();
            this.address = in.readString();
            this.is_default = in.readInt();
            this.is_effect = in.readInt();
            this.updated_at = in.readString();
            this.created_at = in.readString();
            this.headAddress = in.readString();
        }

        public static final Creator<DatasBean> CREATOR = new Creator<DatasBean>() {
            @Override
            public DatasBean createFromParcel(Parcel source) {
                return new DatasBean(source);
            }

            @Override
            public DatasBean[] newArray(int size) {
                return new DatasBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeTypedList(this.datas);
    }

    public AddressListsModel() {
    }

    protected AddressListsModel(Parcel in) {
        this.datas = in.createTypedArrayList(DatasBean.CREATOR);
    }

    public static final Creator<AddressListsModel> CREATOR = new Creator<AddressListsModel>() {
        @Override
        public AddressListsModel createFromParcel(Parcel source) {
            return new AddressListsModel(source);
        }

        @Override
        public AddressListsModel[] newArray(int size) {
            return new AddressListsModel[size];
        }
    };
}
